package com.weipai.education.dao.impl;

import com.weipai.education.dao.ActivityCateDao;
import com.weipai.education.mapper.ActivityCateMapper;
import com.weipai.education.model.ActivityCate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author: 曹朋飞
 * @Date: 2018/12/11 09:53
 */
@Repository
public class ActivityCateDaoImpl implements ActivityCateDao {
    
    @Autowired
    private ActivityCateMapper activityCateMapper;

    @Override
    public int update(ActivityCate activityCate) {
        return activityCateMapper.updateByPrimaryKeySelective(activityCate);
    }

    @Override
    public int insert(ActivityCate activityCate) {
        return activityCateMapper.insert(activityCate);
    }

    @Override
    public ActivityCate selectByPrimaryKey(String id) {
        return activityCateMapper.selectByPrimaryKey(Integer.parseInt(id));
    }

    @Override
    public List<Map<String, Object>> list(Integer start, Integer size) {
        return activityCateMapper.list(start, size);
    }

    @Override
    public Integer listAmount() {
        return activityCateMapper.listAmount();
    }

    @Override
    public int batchDeleteById(String[] id) {
        return activityCateMapper.batchDeleteById(id);
    }
}
